package com.crm.controller;

import com.crm.domain.DataGridView;
import com.crm.pojo.BasicType;
import com.crm.service.BasicTypeService;
import com.crm.vo.BasicTypeVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

@RestController
public class BasicTypeController {
    @Autowired
    private BasicTypeService basicTypeService;
    private BasicTypeVo basicTypeVo;
    @GetMapping(value = "/basicTypes.do")
    public List<BasicType> selectAllBasicTypes(){
        return basicTypeService.findAllBasicTypes() ;
    }
    @GetMapping(value = "/basicTypess.do")
    public DataGridView getServiceDistribute(BasicTypeVo basicTypeVo){
        return basicTypeService.getBasicTypeByPage(basicTypeVo);
    }
    @GetMapping("/cusomerlist.do")
    public DataGridView cusomerlist() {
        List<BasicType> list = basicTypeService.findAllBasicTypes();
        return new DataGridView(Long.valueOf(list.size()), list);
    }
}
